/**
 * FileFind - ftp/shares indexing and search php engine
 * Module: common
 * Description: Common classes
 * Copyright (c) 2003-2010 Rage Steel, www.gt2.ru
 */
package ru.ffind.common.model;

import com.google.common.collect.ImmutableList;

/**
 * Directory item
 * Use iterator to get files, if there is no error
 * If there is a error, than getting iterator throws UnsupportedOperationException
 * 
 * @author Rage Steel
 */
public interface Directory extends Entry {
	
	/**
	 * 
	 * Return status of reading of this directory
	 * 
	 * @return True if directory does not read at all
	 * 
	 */
	boolean isError();
	
	/**
	 * 
	 * Return count of files/directories in the directory;
	 * 
	 * @return count of files/directories or 0 if this is a error directory
	 * 
	 */
	long getCount();
	
	/**
	 * 
	 * Get listing of the directory
	 * May return null that indicates that directory is a placeholder
	 * 
	 * @return listing
	 * @throws UnsupportedOperationException if directory is error
	 * 
	 */
	ImmutableList<Entry> getEntries();
	
}
